home *** CD-ROM | disk | FTP | other *** search
- Path: plato.ansa.co.uk!news
- From: tms@ansa.co.uk (Toby Speight)
- Newsgroups: comp.lang.c++
- Subject: Re: How to read in binary file?
- Date: 6 Mar 1996 14:23:09 GMT
- Organization: ANSA, Cambridge, England.
- Sender: tms@socrates.ansa.co.uk
- Message-ID: <s8ohqauwxa.fsf@socrates.ansa.co.uk>
- References: <4lCptna00iV5Q5qSZK@andrew.cmu.edu> <4hjdng$elu@sam.inforamp.net>
- NNTP-Posting-Host: socrates.ansa.co.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=US-ASCII
- Content-Transfer-Encoding: 7bit
- In-reply-to: rmorin@inforamp.net's message of Wed, 06 Mar 96 07:09:44 GMT
- X-Phone: +44 1223 568925
- X-Fax: +44 1223 359779
- X-Yow: Wait.. is this a FUN THING or the END of LIFE in Petticoat Junction??
- X-Newsreader: Gnus v5.1
-
- -----BEGIN PGP SIGNED MESSAGE-----
-
- >>>>> In article <4lCptna00iV5Q5qSZK@andrew.cmu.edu>,
- >>>>> "Sang Hyun Park, Shawn" <sangp+@andrew.cmu.edu> wrote:
-
- >> void main(void)
- >> {
- >> short buf[2000]; // arbitrary size for trial
- >> ifstream ins("filename.bin");
- >> ins.get(buf, 2000); *
- >> }
-
- >>>>> In article <4hjdng$elu@sam.inforamp.net>,
- >>>>> Randy == "Randy Charles Morin" <rmorin@inforamp.net> writes:
-
- Randy> You should make the following change...
- Randy> ins.get((char *)buf, sizeof(short)*2000);
-
- Why not
-
- ins.get( (char*)buf, sizeof buf);
-
-
- -----BEGIN PGP SIGNATURE-----
- Version: 2.6.2i
- Comment: Processed by Mailcrypt 3.4, an Emacs/PGP interface
-
- iQB1AwUBMT2ezOdsuUurvcRtAQHxjwMAqNdiSU3/pG4DKcmtzZFD8ywNKPazor3R
- IPKxkhBw8TXdSi2b7RSqny2Xu+IYXsiK374g1DlAPIngnFlTcJ+MUiopKMXKCCFW
- o3IASGIOx7Zawkv0SYg3tlsKqxuBpE+V
- =2Nb+
- -----END PGP SIGNATURE-----
- --
- Toby Speight <tms@ansa.co.uk> Phone +44 1223 568925, Fax +44 1223 359779
- APM Ltd., Poseidon House, Castle Park, Cambridge CB3 0RD
-